package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class HostParameterSpecification implements GeneralValueSpecification, SimpleTargetSpecification, TargetSpecification {

    private int beginIndex;
    private int endIndex;
    private HostParameterName hostParameterName;
    private IndicatorParameter indicatorParameter;

    public HostParameterSpecification(HostParameterName hostParameterName,
                                      IndicatorParameter indicatorParameter) {
        this.beginIndex = hostParameterName.getBeginIndex();
        this.endIndex = indicatorParameter != null ? indicatorParameter.getEndIndex() : hostParameterName.getEndIndex();
        this.hostParameterName = hostParameterName;
        this.indicatorParameter = indicatorParameter;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public HostParameterName getHostParameterName() {
        return hostParameterName;
    }

    public IndicatorParameter getIndicatorParameter() {
        return indicatorParameter;
    }

}
